package com.axjy.item.client;

import com.axjy.comm.client.ItemClient;
import com.axjy.comm.pojo.TpItem;
import com.axjy.item.mapper.ItemMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
public class ItemClientImpl implements ItemClient {

    @Resource
    private ItemMapper itemMapper;

    @Value("${eureka.instance.instance-id}")
    private String instanceId;

    @Override
    public TpItem findByTargetId(Integer itemId) {
        TpItem tpItem= itemMapper.selectById(itemId);
        tpItem.setItemName(instanceId);
        return tpItem;
    }
}
